import java.io.*;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-04-21
 * Time: 15:29
 */
public class TestDemo2 {
    public static void main(String[] args) throws IOException {
        //创建一个BufferedReader缓冲对象，用于读文件数据
        BufferedReader in=new BufferedReader(new FileReader("许浩斌.txt"));
        //创建一个BufferedWriter缓冲对象，用于写文件数据
        BufferedWriter out=new BufferedWriter(new FileWriter("许浩斌.txt"));
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        out.write(str);
        out.flush();
        BufferedWriter out2=new BufferedWriter(new FileWriter("soruce\\许浩斌.txt"));
        String line=null;
        while((line=in.readLine())!=null){
            out2.write(line);
            out2.newLine();
            out.flush();
        }
        in.close();
        scanner.close();
        out.close();
        out2.close();
    }
}
